/*
package jobtest;

import com.alibaba.fastjson.JSON;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.streams.*;
import org.apache.kafka.streams.kstream.KStream;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.CountDownLatch;

public class KafkaStreamTest {
    public static void main(String[] args) throws Exception {
        Properties props = new Properties();
        props.put(StreamsConfig.APPLICATION_ID_CONFIG, "streams-pipe");
        props.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
        props.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes
                .String().getClass());
        props.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass());

        final StreamsBuilder builder = new StreamsBuilder();

        List<String> topics = new ArrayList<>(20);
        topics.add("tx_order_local_mo_test1.tx_order.tx_order_0");
        topics.add("tx_order_local_mo_test1.tx_order.tx_order_1");
        KStream<Object, Object> ks = builder.stream(topics);

        ks = ks.map((key, value) -> {
            KeyValue<Object, Object> keyValue;
            keyValue = new KeyValue<>(JSON.toJSONString("key"), value);
            return keyValue;
        });


        ks.to("to.test.1");
        final Topology topology = builder.build();
        final KafkaStreams streams = new KafkaStreams(topology, props);


        final CountDownLatch latch = new CountDownLatch(1);


        Runtime.getRuntime().addShutdownHook(new Thread("streams-shutdown-hook") {
            @Override
            public void run() {
                streams.close();
                latch.countDown();
            }
        });

        try {
            streams.start();
            latch.await();
        } catch (Throwable e) {
            System.exit(1);
        }
        System.exit(0);
    }
}
*/
